/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file. */

/* Special attribute to hide elements. */
[hidden] {
  display: none !important;
}

/* "chrome-menu" class overrides some standard menu.css styles, to make custom
   menus in FileBrowser look like native ChromeOS menus. */

cr-menu.chrome-menu {
  background-color: white;
  border-radius: 2px;
  box-shadow: 0 1px 4px 0 rgba(0, 0, 0, .5);
  color: rgb(51, 51, 51);
  outline: none;
  overflow: hidden;
  padding: 8px 0;
  transition: opacity 200ms ease-in;
  z-index: 600;  /* Must be below the overlay pane (1000). */
}

cr-menu.chrome-menu[hidden] {
  display: block !important;  /* Overrides default [hidden] for animation. */
  opacity: 0;
  pointer-events: none;
  visibility: hidden;
}

cr-menu.chrome-menu.hide-delayed[hidden] {
  transition-delay: 120ms;
  transition-property: opacity, visibility;
}

cr-menu.chrome-menu > :not(hr) {
  background-position: right 10px center;
  background-repeat: no-repeat;
  line-height: 32px;
  outline: none;
  padding: 0 8px;
}

html[dir='rtl'] cr-menu.chrome-menu > :not(hr) {
  background-position: left 10px center;
}

cr-menu.chrome-menu > .menuitem-button {
  background-position: center;
  background-repeat: no-repeat;
  border: 1px solid rgb(235, 235, 235);
  height: 42px;
  margin: -36px -1px -1px 0;
  min-width: 60px;
  padding: 0;
  position: absolute;
  width: 60px;
}

cr-menu.chrome-menu > .menuitem-button[checked] {
  background-color: rgb(235, 235, 235);
}

cr-menu.chrome-menu > .menuitem-button.left {
  right: 59px;
}

html[dir='rtl'] cr-menu.chrome-menu > .menuitem-button.left {
  left: 59px;
  right: auto;
}

cr-menu.chrome-menu > .menuitem-button.right {
  right: 0;
}

html[dir='rtl'] cr-menu.chrome-menu > .menuitem-button.right {
  left: 0;
  right: auto;
}

cr-menu.chrome-menu > cr-menu-item[disabled] {
  color: rgba(51, 51, 51, 0.20);
}

cr-menu.chrome-menu > cr-menu-item:not([disabled])[selected],
cr-menu.chrome-menu > cr-menu-item:not([disabled]):active {
  background-color: rgba(0, 0, 0, 0.08);
}

cr-menu.chrome-menu > hr {
  background: rgb(219, 219, 219);
  height: 1px;
  margin: 4px 0;
}

cr-menu.chrome-menu > hr:first-child {
  display: none;
}

cr-menu.chrome-menu > cr-menu-item[checked] {
  background-image: -webkit-image-set(
    url(../images/common/check_no_box.png) 1x,
    url(../images/common/2x/check_no_box.png) 2x);
}

cr-menu.chrome-menu > [checked]::before {
  display: none;
}

/* Style for <button>s to have similar style with Polymer's <paper-button>. */
.imitate-paper-button,
.cr-dialog-buttons > button {
  -webkit-user-select: none;
  background: transparent;
  border: 0;
  border-image: none;
  border-radius: 3px;
  box-sizing: border-box;
  color: inherit;
  cursor: pointer;
  display: inline-block;
  font: inherit;
  height: auto;
  margin: 0 0.29em;
  min-width: 5.14em;
  outline: none;
  overflow: hidden;
  padding: 0.7em 0.57em;
  position: relative;
  text-align: center;
  text-transform: uppercase;
  z-index: 0;
}

.cr-dialog-buttons > button {
  -webkit-margin-end: 0;
  -webkit-margin-start: 5px;
  font-weight: 500;
  height: 32px;
  min-width: 70px;
  padding: auto;
}

.cr-dialog-buttons > button.cr-dialog-ok {
  background-color: rgb(33, 150, 243);
  color: white;
}

.cr-dialog-buttons > button.cr-dialog-cancel {
  color: rgb(100, 100, 100);
}

.cr-dialog-buttons > button.cr-dialog-cancel:hover {
  color: rgb(33, 150, 243);
}

.cr-dialog-buttons > button[disabled],
.cr-dialog-buttons > button[disabled]:hover {
  background-color: rgb(234, 234, 234);
  color: rgb(168, 168, 168);
}

.cr-dialog-buttons > button:focus:not(:active) {
  box-shadow: 0 0 0 2px rgba(33, 150, 243, 0.5);
}

.buttonbar button {
  -webkit-margin-start: 12px;
}

/* Gray progress bar. */
.progress-bar {
  background-color: #e6e6e6;
  border-radius: 3px;
  height: 6px;
}

.progress-track {
  background-color: #888;
  border-radius: 3px;
  height: 6px;
  min-width: 6px;
}

/* Entry names (File names, Folder names, Volume names, ...). */
/* Their base bidi direction should be ltr even in RTL languages. */
html[dir='rtl'] .entry-name {
  direction: ltr;
  text-align: right;
  unicode-bidi: embed;
}

/* Pop-up dialogs. */

.cr-dialog-container {
  -webkit-user-select: none;
  align-items: center;
  display: flex;
  height: 100%;
  justify-content: center;
  left: 0;
  overflow: hidden;
  position: absolute;
  top: 0;
  transition: opacity 250ms linear;
  width: 100%;
  z-index: 9999;
}

.cr-dialog-frame {
  background-color: white;
  border-radius: 2px;
  box-shadow: 0 2px 4px 0 rgba(0, 0, 0, 0.2),
              0 2px 6px 0 rgba(0, 0, 0, 0.1);
  color: rgb(34, 34, 34);
  cursor: default;
  display: flex;
  flex-direction: column;
  padding: 12px;
  position: relative;
  width: 386px;
}

.cr-dialog-frame:focus {
  outline: none;
}

@-webkit-keyframes pulse {
 0% {
   -webkit-transform: scale(1);
 }
 40% {
   -webkit-transform: scale(1.02);
  }
 60% {
   -webkit-transform: scale(1.02);
  }
 100% {
   -webkit-transform: scale(1);
 }
}

.cr-dialog-frame.pulse {
  -webkit-animation-duration: 180ms;
  -webkit-animation-iteration-count: 1;
  -webkit-animation-name: pulse;
  -webkit-animation-timing-function: ease-in-out;
}

.shown > .cr-dialog-frame {
  opacity: 1;
}

.cr-dialog-frame {
  opacity: 0;
  transition: opacity 250ms;
}

.cr-dialog-title {
  -webkit-margin-end: 20px;
  -webkit-margin-start: 4px;
  display: block;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 10px;
  margin-top: 4px;
  white-space: nowrap;
  word-wrap: normal;
}

.cr-dialog-text {
  font-size: 12px;
  margin: 4px 4px 10px 4px;
}

.cr-dialog-text,
.cr-dialog-title {
  color: black;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cr-dialog-frame input {
  box-sizing: border-box;
  width: 100%;
}

.cr-dialog-buttons {
  display: flex;
  flex-direction: row;
  justify-content: flex-end;
  padding-top: 24px;
}

.cr-dialog-close {
  background: -webkit-image-set(
      url(../images/files/ui/close_button.png) 1x,
      url(../images/files/ui/2x/close_button.png) 2x) center no-repeat;
  display: inline-block;
  height: 40px;
  opacity: 0.7;
  position: absolute;
  right: 0;
  top: 0;
  width: 40px;
}

html[dir='rtl'] .cr-dialog-close {
  left: 0;
  right: auto;
}

.cr-dialog-close:hover {
  opacity: 0.9;
}

.cr-dialog-close:active {
  opacity: 1;
}

.files-alert-dialog .cr-dialog-close,
.files-confirm-dialog .cr-dialog-close {
  display: none;
}

.files-alert-dialog .cr-dialog-text,
.files-confirm-dialog .cr-dialog-text {
  font-size: 14px;
}

/* Minor tweak of vertical position for texts which need to be vertically
 * aligned with corresponding file-type icons. */
.tree-row > .label,
.table-row-cell .filename-label,
.table-row-cell .size,
.table-row-cell .type,
.table-row-cell .date,
.thumbnail-bottom .filename-label,
.autocomplete-suggestions > li > .detail-text {
  padding-top: 1px;
}

@media (-webkit-min-device-pixel-ratio: 1.5) {
  .tree-row > .label,
  .table-row-cell .filename-label,
  .table-row-cell .size,
  .table-row-cell .type,
  .table-row-cell .date,
  .thumbnail-bottom .filename-label,
  .autocomplete-suggestions > li > .detail-text {
    /* In HiDPI display, 13pt Roboto font is drawn upper than normal display,
     * so add extra padding on top of it. */
    padding-top: 3px;
  }
}
